package com.clusterswisdom.horn.api.tmall.action.sellercats;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.tmall.TmallInstance;
import com.clusterswisdom.horn.api.tmall.action.AbstractTmallAction;
import com.taobao.api.response.ShopcatsListGetResponse;

public class GetShopcatsListAction extends AbstractTmallAction implements HornAction{
	@Override
	public HornResponse execute(ApiConfig config, JSONObject param)
			throws Exception {
		ShopcatsListGetResponse  response=(ShopcatsListGetResponse)TmallInstance.getInstance().executeRequest(param, "sellercats", "shopcatsListGet");
		if(response.isSuccess()){
			return new HornResponse(true, response.getShopCats());
			
		}else{
			return getUnsuccessResponse(response);
			
		}
	}
}
